home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.8 KB | 68 lines | [TEXT/ttxt] |
- --<<<
-
- object lookupTable (HashTable) end
- add lookupTable @groink (a b -> processGroink a b)
- add lookupTable @ululate (a b -> processUlulate a b)
- add lookupTable @giggle (a b -> processGiggle a b)
-
- object kiwi (Rect)
- x2:100, y2:100
- instance variables
- name:"baah", activity:@groink
- end
-
- object aussie (TextPresenter)
- boundary:(new Rect x2:50 y2:100), \
- target:("gudday mate" as String)
- instance variables
- name:"mathilda", activity:@ululate
- end
-
- object texan (MouseUpEvent)
- x2:100, y2:100
- instance variables
- name:"hazel", activity:@giggle
- end
-
- object sourceTable (LinkedList) end
- append sourceTable kiwi
- append sourceTable texan
- append sourceTable aussie
-
- global readTable
- class ActivityReader (RootObject)
- instance methods
- method readTable self source table -> (
- if not isAKindOf table ExplicitlyKeyedCollection do
- report badParameter #(table, self, readTable,
- "Expected an explicitly keyed collection")
- if isAKindOf source LinearCollection then (
- local i := iterate source
- repeat while (next i) do (
- if hasKey table (i.value.activity) then
- table[i.value.activity] self i.value
- else
- report generalError "missing table entry"
- )
- )
- else (
- report badParameter #(source, self, readTable,
- "Expected a linear collection")
- )
- )
- method processGroink self obj ->
- format debug "Object %1, of class %2, just groinked.\n" \
- #(obj.name, (getClass obj))
- method processUlulate self obj ->
- format debug "Object %1, of class %2, just ululated.\n" \
- #(obj.name, (getClass obj))
- method processGiggle self obj ->
- format debug "Object %1, of class %2, just giggled.\n" \
- #(obj.name, (getClass obj))
- end
-
- global myActivityReader := new ActivityReader
- readTable myActivityReader sourceTable lookupTable
-
- -->>>
-